<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Special Accessors (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Special Accessors (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Special Accessors (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="RTL.html" rel="up" title="RTL">
<link href="Flags.html" rel="next" title="Flags">
<link href="Accessors.html" rel="prev" title="Accessors">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="section-level-extent" id="Special-Accessors">
<div class="nav-panel">
<p>
Next: <a href="Flags.html" accesskey="n" rel="next">Flags in an RTL Expression</a>, Previous: <a href="Accessors.html" accesskey="p" rel="prev">Access to Operands</a>, Up: <a href="RTL.html" accesskey="u" rel="up">RTL Representation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Access-to-Special-Operands"><span>14.4 Access to Special Operands<a class="copiable-link" href="#Access-to-Special-Operands"> &para;</a></span></h3>
<a class="index-entry-id" id="index-access-to-special-operands"></a>

<p>Some RTL nodes have special annotations associated with them.
</p>
<dl class="table">
<dt><code class="code">MEM</code></dt>
<dd><dl class="table">
<dt><a id="index-MEM_005fALIAS_005fSET"></a><span><code class="code">MEM_ALIAS_SET (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fALIAS_005fSET"> &para;</a></span></dt>
<dd><p>If 0, <var class="var">x</var> is not in any alias set, and may alias anything.  Otherwise,
<var class="var">x</var> can only alias <code class="code">MEM</code>s in a conflicting alias set.  This value
is set in a language-dependent manner in the front-end, and should not be
altered in the back-end.  In some front-ends, these numbers may correspond
in some way to types, or other language-level entities, but they need not,
and the back-end makes no such assumptions.
These set numbers are tested with <code class="code">alias_sets_conflict_p</code>.
</p>
</dd>
<dt><a id="index-MEM_005fEXPR"></a><span><code class="code">MEM_EXPR (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fEXPR"> &para;</a></span></dt>
<dd><p>If this register is known to hold the value of some user-level
declaration, this is that tree node.  It may also be a
<code class="code">COMPONENT_REF</code>, in which case this is some field reference,
and <code class="code">TREE_OPERAND (<var class="var">x</var>, 0)</code> contains the declaration,
or another <code class="code">COMPONENT_REF</code>, or null if there is no compile-time
object associated with the reference.
</p>
</dd>
<dt><a id="index-MEM_005fOFFSET_005fKNOWN_005fP"></a><span><code class="code">MEM_OFFSET_KNOWN_P (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fOFFSET_005fKNOWN_005fP"> &para;</a></span></dt>
<dd><p>True if the offset of the memory reference from <code class="code">MEM_EXPR</code> is known.
&lsquo;<samp class="samp">MEM_OFFSET (<var class="var">x</var>)</samp>&rsquo; provides the offset if so.
</p>
</dd>
<dt><a id="index-MEM_005fOFFSET"></a><span><code class="code">MEM_OFFSET (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fOFFSET"> &para;</a></span></dt>
<dd><p>The offset from the start of <code class="code">MEM_EXPR</code>.  The value is only valid if
&lsquo;<samp class="samp">MEM_OFFSET_KNOWN_P (<var class="var">x</var>)</samp>&rsquo; is true.
</p>
</dd>
<dt><a id="index-MEM_005fSIZE_005fKNOWN_005fP"></a><span><code class="code">MEM_SIZE_KNOWN_P (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fSIZE_005fKNOWN_005fP"> &para;</a></span></dt>
<dd><p>True if the size of the memory reference is known.
&lsquo;<samp class="samp">MEM_SIZE (<var class="var">x</var>)</samp>&rsquo; provides its size if so.
</p>
</dd>
<dt><a id="index-MEM_005fSIZE"></a><span><code class="code">MEM_SIZE (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fSIZE"> &para;</a></span></dt>
<dd><p>The size in bytes of the memory reference.
This is mostly relevant for <code class="code">BLKmode</code> references as otherwise
the size is implied by the mode.  The value is only valid if
&lsquo;<samp class="samp">MEM_SIZE_KNOWN_P (<var class="var">x</var>)</samp>&rsquo; is true.
</p>
</dd>
<dt><a id="index-MEM_005fALIGN"></a><span><code class="code">MEM_ALIGN (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fALIGN"> &para;</a></span></dt>
<dd><p>The known alignment in bits of the memory reference.
</p>
</dd>
<dt><a id="index-MEM_005fADDR_005fSPACE"></a><span><code class="code">MEM_ADDR_SPACE (<var class="var">x</var>)</code><a class="copiable-link" href="#index-MEM_005fADDR_005fSPACE"> &para;</a></span></dt>
<dd><p>The address space of the memory reference.  This will commonly be zero
for the generic address space.
</p></dd>
</dl>

</dd>
<dt><code class="code">REG</code></dt>
<dd><dl class="table">
<dt><a id="index-ORIGINAL_005fREGNO"></a><span><code class="code">ORIGINAL_REGNO (<var class="var">x</var>)</code><a class="copiable-link" href="#index-ORIGINAL_005fREGNO"> &para;</a></span></dt>
<dd><p>This field holds the number the register &ldquo;originally&rdquo; had; for a
pseudo register turned into a hard reg this will hold the old pseudo
register number.
</p>
</dd>
<dt><a id="index-REG_005fEXPR"></a><span><code class="code">REG_EXPR (<var class="var">x</var>)</code><a class="copiable-link" href="#index-REG_005fEXPR"> &para;</a></span></dt>
<dd><p>If this register is known to hold the value of some user-level
declaration, this is that tree node.
</p>
</dd>
<dt><a id="index-REG_005fOFFSET"></a><span><code class="code">REG_OFFSET (<var class="var">x</var>)</code><a class="copiable-link" href="#index-REG_005fOFFSET"> &para;</a></span></dt>
<dd><p>If this register is known to hold the value of some user-level
declaration, this is the offset into that logical storage.
</p></dd>
</dl>

</dd>
<dt><code class="code">SYMBOL_REF</code></dt>
<dd><dl class="table">
<dt><a id="index-SYMBOL_005fREF_005fDECL"></a><span><code class="code">SYMBOL_REF_DECL (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fDECL"> &para;</a></span></dt>
<dd><p>If the <code class="code">symbol_ref</code> <var class="var">x</var> was created for a <code class="code">VAR_DECL</code> or
a <code class="code">FUNCTION_DECL</code>, that tree is recorded here.  If this value is
null, then <var class="var">x</var> was created by back end code generation routines,
and there is no associated front end symbol table entry.
</p>
<p><code class="code">SYMBOL_REF_DECL</code> may also point to a tree of class <code class="code">'c'</code>,
that is, some sort of constant.  In this case, the <code class="code">symbol_ref</code>
is an entry in the per-file constant pool; again, there is no associated
front end symbol table entry.
</p>
</dd>
<dt><a id="index-SYMBOL_005fREF_005fCONSTANT"></a><span><code class="code">SYMBOL_REF_CONSTANT (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fCONSTANT"> &para;</a></span></dt>
<dd><p>If &lsquo;<samp class="samp">CONSTANT_POOL_ADDRESS_P (<var class="var">x</var>)</samp>&rsquo; is true, this is the constant
pool entry for <var class="var">x</var>.  It is null otherwise.
</p>
</dd>
<dt><a id="index-SYMBOL_005fREF_005fDATA"></a><span><code class="code">SYMBOL_REF_DATA (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fDATA"> &para;</a></span></dt>
<dd><p>A field of opaque type used to store <code class="code">SYMBOL_REF_DECL</code> or
<code class="code">SYMBOL_REF_CONSTANT</code>.
</p>
</dd>
<dt><a id="index-SYMBOL_005fREF_005fFLAGS"></a><span><code class="code">SYMBOL_REF_FLAGS (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fFLAGS"> &para;</a></span></dt>
<dd><p>In a <code class="code">symbol_ref</code>, this is used to communicate various predicates
about the symbol.  Some of these are common enough to be computed by
common code, some are specific to the target.  The common bits are:
</p>
<dl class="table">
<dt><a class="index-entry-id" id="index-SYMBOL_005fFLAG_005fFUNCTION"></a>
<a id="index-SYMBOL_005fREF_005fFUNCTION_005fP"></a><span><code class="code">SYMBOL_FLAG_FUNCTION</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fFUNCTION_005fP"> &para;</a></span></dt>
<dd><p>Set if the symbol refers to a function.
</p>
</dd>
<dt><a class="index-entry-id" id="index-SYMBOL_005fFLAG_005fLOCAL"></a>
<a id="index-SYMBOL_005fREF_005fLOCAL_005fP"></a><span><code class="code">SYMBOL_FLAG_LOCAL</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fLOCAL_005fP"> &para;</a></span></dt>
<dd><p>Set if the symbol is local to this &ldquo;module&rdquo;.
See <code class="code">TARGET_BINDS_LOCAL_P</code>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-SYMBOL_005fFLAG_005fEXTERNAL"></a>
<a id="index-SYMBOL_005fREF_005fEXTERNAL_005fP"></a><span><code class="code">SYMBOL_FLAG_EXTERNAL</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fEXTERNAL_005fP"> &para;</a></span></dt>
<dd><p>Set if this symbol is not defined in this translation unit.
Note that this is not the inverse of <code class="code">SYMBOL_FLAG_LOCAL</code>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-SYMBOL_005fFLAG_005fSMALL"></a>
<a id="index-SYMBOL_005fREF_005fSMALL_005fP"></a><span><code class="code">SYMBOL_FLAG_SMALL</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fSMALL_005fP"> &para;</a></span></dt>
<dd><p>Set if the symbol is located in the small data section.
See <code class="code">TARGET_IN_SMALL_DATA_P</code>.
</p>
</dd>
<dt><a class="index-entry-id" id="index-SYMBOL_005fREF_005fTLS_005fMODEL"></a>
<a id="index-SYMBOL_005fFLAG_005fTLS_005fSHIFT"></a><span><code class="code">SYMBOL_REF_TLS_MODEL (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fFLAG_005fTLS_005fSHIFT"> &para;</a></span></dt>
<dd><p>This is a multi-bit field accessor that returns the <code class="code">tls_model</code>
to be used for a thread-local storage symbol.  It returns zero for
non-thread-local symbols.
</p>
</dd>
<dt><a class="index-entry-id" id="index-SYMBOL_005fFLAG_005fHAS_005fBLOCK_005fINFO"></a>
<a id="index-SYMBOL_005fREF_005fHAS_005fBLOCK_005fINFO_005fP"></a><span><code class="code">SYMBOL_FLAG_HAS_BLOCK_INFO</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fHAS_005fBLOCK_005fINFO_005fP"> &para;</a></span></dt>
<dd><p>Set if the symbol has <code class="code">SYMBOL_REF_BLOCK</code> and
<code class="code">SYMBOL_REF_BLOCK_OFFSET</code> fields.
</p>
</dd>
<dt><a class="index-entry-id" id="index-SYMBOL_005fFLAG_005fANCHOR"></a>
<a class="index-entry-id" id="index-_002dfsection_002danchors"></a>
<a id="index-SYMBOL_005fREF_005fANCHOR_005fP"></a><span><code class="code">SYMBOL_FLAG_ANCHOR</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fANCHOR_005fP"> &para;</a></span></dt>
<dd><p>Set if the symbol is used as a section anchor.  &ldquo;Section anchors&rdquo;
are symbols that have a known position within an <code class="code">object_block</code>
and that can be used to access nearby members of that block.
They are used to implement <samp class="option">-fsection-anchors</samp>.
</p>
<p>If this flag is set, then <code class="code">SYMBOL_FLAG_HAS_BLOCK_INFO</code> will be too.
</p></dd>
</dl>

<p>Bits beginning with <code class="code">SYMBOL_FLAG_MACH_DEP</code> are available for
the target&rsquo;s use.
</p></dd>
</dl>

</dd>
<dt><a id="index-SYMBOL_005fREF_005fBLOCK"></a><span><code class="code">SYMBOL_REF_BLOCK (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fBLOCK"> &para;</a></span></dt>
<dd><p>If &lsquo;<samp class="samp">SYMBOL_REF_HAS_BLOCK_INFO_P (<var class="var">x</var>)</samp>&rsquo;, this is the
&lsquo;<samp class="samp">object_block</samp>&rsquo; structure to which the symbol belongs,
or <code class="code">NULL</code> if it has not been assigned a block.
</p>
</dd>
<dt><a id="index-SYMBOL_005fREF_005fBLOCK_005fOFFSET"></a><span><code class="code">SYMBOL_REF_BLOCK_OFFSET (<var class="var">x</var>)</code><a class="copiable-link" href="#index-SYMBOL_005fREF_005fBLOCK_005fOFFSET"> &para;</a></span></dt>
<dd><p>If &lsquo;<samp class="samp">SYMBOL_REF_HAS_BLOCK_INFO_P (<var class="var">x</var>)</samp>&rsquo;, this is the offset of <var class="var">x</var>
from the first object in &lsquo;<samp class="samp">SYMBOL_REF_BLOCK (<var class="var">x</var>)</samp>&rsquo;.  The value is
negative if <var class="var">x</var> has not yet been assigned to a block, or it has not
been given an offset within that block.
</p></dd>
</dl>

</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Flags.html">Flags in an RTL Expression</a>, Previous: <a href="Accessors.html">Access to Operands</a>, Up: <a href="RTL.html">RTL Representation</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
